const path=require("path")
const { override, fixBabelImports, addLessLoader,addBabelPlugins,addWebpackAlias   } = require("customize-cra");

const modifyVars=require("./theme/index.js")//antd主题配置颜色
module.exports = override(
  addWebpackAlias({
    '@': path.resolve(__dirname, 'src'),
    'components': path.resolve(__dirname, 'src/components')
  }),
  ...addBabelPlugins( // 支持装饰器
    [
      '@babel/plugin-proposal-decorators',
      { legacy: true}
    ]
  ),
  addLessLoader({
    javascriptEnabled: true,
    modifyVars
  }),
  fixBabelImports("import", {
    libraryName: "antd",
    libraryDirectory: "es",
    style: 'css'
  })
);
